<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>采购明细表</title>
    <style>
    .choice{
        display: inline-block;
        margin-right: 30px;
        font-size: 18px;
    }
    .td{
        padding-top: 15px;
        padding-bottom: 15px;
        padding-left: 40px;
        padding-right: 40px;
    }
    </style>
    <script>
        $.ajax({
            type:"post",
            url:"../../item/selectAllItem.do",
            success:function (data) {
                console.log(data);
                var content = "";
                console.log(data.data.length);
                for(var i = 0;i<data.data.length;i++){
                    content = content + "<option name='iid' id='item' value="+"\""+data.data[i].iid+"\""+">"+data.data[i].name + "</option>\n";
                }
                var a = $("#items").html(content);
            }
        });
    </script>
</head>


<body>

<div class="head" style="margin-bottom: 20px">

    <form action="../../buy/selectIntoByIidAndDate.do" method="post" id="form1">
        <div class="choice">
            <label>商品：</label>
            <select id="items">

            </select>
        </div>
        <div class="choice">
            <label>时间：</label>
            <input id="date" type="date" name="date">
        </div>

        <div class="choice">
            <input type="submit" value="查询" style="border: aliceblue;background-color: blue;font-size: 18px;">
        </div>

    </form>


    <div class="choice">
        <button type="button" class="button" style="border: blue;background-color: aqua;font-size: 18px;">生成退货单</button>
    </div>


</div>

<div class="body">

    <table id="table1" border="|" style="font-size: 14px">
        <tr>
            <td class="td">采购单编号</td>
            <td class="td">商品名称</td>
            <td class="td">供货商</td>
            <td class="td">单价</td>
            <td class="td">数量</td>
            <td class="td">仓库</td>
            <td class="td">总价</td>
            <td class="td">时间</td>
            <td class="td">采购人</td>
            <td class="td">备注</td>
            <td class="td">生成采购单</td>
        </tr>
    </table>
</div>


</body>

<script>
    $(function () {

        $("#form1").ajaxForm(function (data) {
                console.log(data);
                var content = "";
                for(var i = 0;i<data.length;i++){
                    content = content + " <tr>\n" +
                        "            <td class=\"td\">"+data.data[i].intoid+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].item.name+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].supplier.sname+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].price+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].count+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].stock.stname+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].total+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].date+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].employer.ename+"</td>\n" +
                        "            <td class=\"td\">"+data.data[i].info+"</td>\n" +
                        "            <td class=\"td\"><input type='checkbox'></td>\n" +
                        "        </tr>";
                }
            }
        );
    });
</script>


</html>